{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
	<h3 class="pb-3">编辑抽奖用户</h3>
	<table class="layui-table layui-table-form">
		<tr><td class="layui-td-gray-2">手机号码<font>*</font></td>
			<td><input type="text" name="phone_number"  lay-verify="required" lay-reqText="请完善手机号码" value="{$detail.phone_number}" autocomplete="off" placeholder="请输入手机号码" class="layui-input"></td><td class="layui-td-gray-2">姓名<font>*</font></td>
			<td><input type="text" name="real_name"  lay-verify="required" lay-reqText="请完善姓名" value="{$detail.real_name}" autocomplete="off" placeholder="请输入姓名" class="layui-input"></td><td class="layui-td-gray-2">签到时间<font>*</font></td>
			<td><input type="text" name="sign_time"  lay-verify="required" lay-reqText="请完善签到时间" value="{$detail.sign_time}" autocomplete="off" placeholder="请输入签到时间" class="layui-input"></td>
		</tr>
				<tr><td class="layui-td-gray-2">头像url<font>*</font></td>
			<td><input type="text" name="avatar_url"  lay-verify="required" lay-reqText="请完善头像url" value="{$detail.avatar_url}" autocomplete="off" placeholder="请输入头像url" class="layui-input"></td><td class="layui-td-gray-2">状态（员工、嘉宾）<font>*</font></td>
			<td>
				<select name="status"  lay-verify="required" lay-reqText="请完善状态（员工、嘉宾）">
					<option value="">请选择</option>
					<option value="员工" {eq name="$detail.status" value="员工"} selected{/eq}>员工</option>
					<option value="嘉宾" {eq name="$detail.status" value="嘉宾"} selected{/eq}>嘉宾</option>
					<option value="未知" {eq name="$detail.status" value="未知"} selected{/eq}>未知</option>
				</select>
			</td><td class="layui-td-gray-2">允许抽奖：1；否则：0<font>*</font></td>
			<td>
				<input type="radio" name="lottery_allow" value="1" title="是" {eq name="$detail.lottery_allow" value="1"} checked{/eq}>
				<input type="radio" name="lottery_allow" value="0" title="否" {eq name="$detail.lottery_allow" value="0"} checked{/eq}>
			</td>
		</tr>
				<tr><td class="layui-td-gray-2">是否已经抽奖<font>*</font></td>
			<td>
				<input type="radio" name="lottery_done" value="0" title="否" {eq name="$detail.lottery_done" value="0"} checked{/eq}>
				<input type="radio" name="lottery_done" value="1" title="是" {eq name="$detail.lottery_done" value="1"} checked{/eq}>
			</td><td colspan='4'></td>
		</tr>
	</table>
	<div class="py-3">
		<input type="hidden" name="id" value="{$detail.id}"/>
		<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
		<button type="reset" class="layui-btn layui-btn-primary">重置</button>
	</div>
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script>
	var moduleInit = ['tool'];

	function gouguInit() {
		var form = layui.form, tool = layui.tool;
		
		
				
		//监听提交
		form.on('submit(webform)', function (data) {
			
			let callback = function (e) {
				layer.msg(e.msg);
				if (e.code == 0) {
					tool.sideClose(1000);
				}
			}
			tool.post("/admin/lottery_user/edit", data.field, callback);
			return false;
		});
	}
</script>
{/block}
<!-- /脚本 -->